<?=n_mod('skin')->pageHead('数据项', array()) ?>
<div class="n-row n-margin-top n-margin-bottom">
	<form method="post" action="<?=n_url('nconfig', 'itemSave')?>">
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">名字</label>
			<div class="n-col-6 n-nopadding">
				<input type="text" name="name" value="<?=$data['name']?>" />
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">KEY</label>
			<div class="n-col-6 n-nopadding">
				<input type="text" name="ukey" value="<?=$data['ukey']?>" />
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">类型</label>
			<div class="n-col-6 n-nopadding">
				<?php
				$api = n_api('nconfig');
				foreach ($api->type as $key => $val) :
				?>
				<input type="radio" name="itype" value="<?=$key?>" <?=$data['itype'] == $key ? 'checked' : '' ?> /><?=$val?>
				<?php
				endforeach;
				?>
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">单位</label>
			<div class="n-col-6 n-nopadding">
				<input type="text" name="unit" value="<?=$data['unit']?>" />
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">可选项</label>
			<div class="n-col-6 n-nopadding">
				<textarea name="option" style="width:100%;resize:none"><?=$data['option']?></textarea>
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="a-form">
			<label class="n-col-2 n-nopadding-left">默认数据</label>
			<div class="n-col-6 n-nopadding">
				<textarea name="default" style="width:100%;resize:none"><?=$data['default']?></textarea>
			</div>
			<div class="n-col-4"></div>
		</div>
		<div class="n-col-2">
			<input name="main_id" type="hidden" value="<?=$data['main_id']?>" />
			<?php
			if (isset($data['id'])) :
			?>
			<input name="id" type="hidden" value="<?=$data['id']?>" />
			<?php
			endif;
			?>
		</div>
		<div class="n-col-4 n-nopadding">
			<div class="a-form">
				<button type="submit" class="a-button-green">
					<i class="fa fa-2x fa-save" style="color:#fff;"></i>
				</button>
			</div>
		</div>
	</form>
	<div class="n-col-2 n-nopadding n-padding-default-left">
		<button class="a-button-default">
			<a target="_self" href="<?=n_url('nconfig', 'itemIndex', array('main_id' => $data['main_id'])) ?>">
				<i class="fa fa-2x fa-remove" style="display:block;"></i>
			</a>
		</button>
	</div>
</div>
